<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCourseSectionQuestionAnswerBacksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('course_section_question_answer_backs', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('answers_id')->comment("问答id");
            $table->unsignedInteger('from_users_id')->comment("评论用户id");
            $table->unsignedInteger('to_users_id')->comment("评论目标用户id");
            $table->text('body')->default('')->comment('内容');
            $table->unsignedInteger('praise')->default(0)->comment("点赞数量")->nullable();
            $table->tinyInteger("adopt")->default(0)->comment("是否采纳[否,是]");

            $table->timestamps();
            $table->softDeletes();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('course_section_question_answer_backs');
    }
}
